/**
 * 
 */
package com.naiterui.ehp.bp.constants;

/**
 * 支付方式
 * @author yiren
 * @since 2.12.0
 */
public enum PayMethodEnum {

    WEIXIN_PAY(1L, PayTypeEnum.ONLINE.getId(), "微信支付",""),
    SHOP_PAY (2L, PayTypeEnum.OFFLINE.getId(), "到店支付", "");

    /** 支付方式ID */
    private Long id;
    /** 支付方式(0:线下, 1:在线) */
    private Integer type;
    /** 支付方式名称 */
    private String name;
    /** 支付方式提示 */
    private String tips;

    PayMethodEnum(Long id, Integer type, String name, String tips) {
        this.id = id;
        this.type = type;
        this.name = name;
        this.tips = tips;
    }


    /**
     * 根据支付方式ID获取支付方式
     * PayMethodEnum.getPayMethodById()
     * @Author guoyongxiang
     * @Date 2017年10月23日
     * @since 2.12.0
     * @param id
     * @return
     */
    public static PayMethodEnum getById(Long id) {
        for (PayMethodEnum method : PayMethodEnum.values()) {
            if (method.getId().equals(id)) {
                return method;
            }
        }
        return null;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTips() {
        return tips;
    }

    public void setTips(String tips) {
        this.tips = tips;
    }

}
